package com.jeff.tianti.cms.dao;

import com.jeff.tianti.common.dao.CustomBaseSqlDaoImpl;
import com.jeff.tianti.common.entity.PageModel;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jeff.tianti.cms.entity.MessageInformCms;
import com.jeff.tianti.cms.dto.MessageInformCmsQueryDTO;

/**
 * @author xujianfang
 * @desc MessageInformCmsDaoImpl��
 * @date 2019-07-12
 */

public class MessageInformCmsDaoImpl extends CustomBaseSqlDaoImpl implements MessageInformCmsDaoCustom {

    public PageModel<MessageInformCms> queryMessageInformCmsPage(MessageInformCmsQueryDTO messageInformCmsQueryDTO) {
        Map<String, Object> map = new HashMap<String, Object>();
        StringBuilder hql = new StringBuilder();
        hql.append("select t from MessageInformCms t ");
        return this.queryForPageWithParams(hql.toString(), map, messageInformCmsQueryDTO.getCurrentPage(), messageInformCmsQueryDTO.getPageSize());
    }

    public List<MessageInformCms> queryMessageInformCmsList(MessageInformCmsQueryDTO messageInformCmsQueryDTO) {
        Map<String, Object> map = new HashMap<String, Object>();
        StringBuilder hql = new StringBuilder();
        hql.append("select t from MessageInformCms t where t.deleteFlag= 0 order by t.createDate desc ");
        return this.queryByMapParams(hql.toString(), map);
    }


}